package com.yowasa.xiuxian.engine.battle.enemy.strategy;

import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.engine.battle.strategy.BaseSpellStrategy;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import com.yowasa.xiuxian.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@BS(name = "岩龙蜥")
@Order(1006)
@Component
public class YanLongXi extends BaseSpellStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int dmg;
        String desc;

        int orgAtk = first.getBattleInfo().getAtk();
        int def = second.getBattleInfo().getDef();
        int atk = (int) (orgAtk * 1.5);
        dmg = battleHelper.calAtk(atk, def);
        //user.getElement().get("土") < XiuxianConstants.DEFAULT_ELEMENT_ACTIVITY
        desc = RandomUtil.choice(Lists.newArrayList("碎岩爪击","钻穴逾垣","钻穴逾垣"));

        battleHelper.autoAction(this, first, second, content, dmg, desc);
    }

    @Override
    public void limit(UserBO user) {
        throw new HandlerException("无法学习妖兽的攻击手段");
    }

    @Override
    public String limitDesc() {
        return "无";
    }

    @Override
    public String desc() {
        return  "有着坚硬岩质甲壳的龙蜥魔物。\n" +
                "行动非常灵活，是不容小觑的对手。须弥教令院的研究认为，即使是这种幼兽，也有成为「龙」的潜质。\n假以时日，如果不受天灾与敌害，或许也有一天能成为撼动高山的巨大魔物吧。\n\n" +
                "分为幼岩龙蜥和巨岩龙蜥，擅长物理攻击 ： 碎岩爪击，钻穴逾垣，钻穴逾垣\n"+
                "出没地点：遁玉陵，渌华池\n" ;
    }


}
